package 牛客周赛.牛客周赛Round88;

import java.util.Scanner;

/**
 * @Title: B
 * @Author 贾金博
 * @Package 牛客周赛.牛客周赛Round88
 * @Date 2025/4/7 上午10:47
 * @description: B题
 */
public class B {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while (t-- > 0 ) {
            // 只要有两个是关于y轴 或者是关于x轴是对称的即可
            zb t1 = new zb();
            t1.x = sc.nextDouble();
            t1.y = sc.nextDouble();

            zb t2 = new zb();
            t2.x = sc.nextDouble();
            t2.y = sc.nextDouble();

            zb t3 = new zb();
            t3.x = sc.nextDouble();
            t3.y = sc.nextDouble();

            if(check(t1, t2, t3) || check(t1, t3, t2) || check(t2, t1, t3) || check(t2, t3, t1) || check(t3, t1, t2) || check(t3, t2, t1)) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }

        }
    }

    private static Boolean check(zb a, zb b, zb c) {

        // 暴力的做法 先去找出a b 的中间点
        double tX = (a.x + b.x) / 2.0;
        double tY = (a.y + b.y) / 2.0;
        // 然后与另外一个点进行比较
        if((tX == c.x && tX == 0) || (tY == c.y && tY == 0)) {
            return true;
        }
        return false;
    }
}

class zb {
    double x;
    double y;
}
